<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style>
		
		*{
			margin:0px;
			padding: 0px;
		}
		li{
			list-style: none;
		}
		.box{
			width: 500px;
			height: 350px;
			background: red url() 0 0 no-repeat;
			margin: 100px auto;
			overflow: hidden;
		}
		.title{
			width: 500px;
			height: 50px;
			background: blue url() 0 0 no-repeat;
		}

		.title li{
			width: 20%;
			height: 50px;
			line-height: 50px;
			text-align: center;
			float: left;
			background: #F5F5F5 url() 0 0 no-repeat;
			cursor: pointer;
		}
		.title .active{
			background: #7FB502 url() 0 0 no-repeat;
			color: #fff;
		}
		.content{
			width: 2500px;
			height: 300px;
			background: yellow url() 0 0 no-repeat;
			position: relative;
			left: 0px;
		}
		.content li{
			width: 500px;
			height: 300px;
			background: yellow url() 0 0 no-repeat;
			text-align: center;
			line-height: 300px;
			font-size: 80px;
			color: #fff;
			background: #7EB409 url() 0 0 no-repeat;
			float: left;
		} 
		.content .show{
			display: block;
		}
	</style>
	<script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
	<script>
		

		$(function () {
			$('.title li').click(function(event) {
				$(this).addClass('active').siblings().removeClass('active');
				num = $(this).index();

				left = num * -500;

				$('.content').animate({left:left+"px"}, 200);

			});
		})
	</script>
</head>
<body>
	<div class="box">
		<ul class="title">
			<li class="active">tab1</li>
			<li>tab2</li>
			<li>tab3</li>
			<li>tab4</li>
			<li>tab5</li>
		</ul>
		<ul class="content">
			<li class="show">content1</li>
			<li>content2</li>
			<li>content3</li>
			<li>content4</li>
			<li>content5</li>
		</ul>
	</div>
</body>
</html>